java set from string array

50

java set from string array -

Set<Integer> targetSet = new HashSet<Integer>(Arrays.asList(sourceArray));

// with google guava
Set<Integer> targetSet = Sets.newHashSet(sourceArray);

Comments

Submit
0 Comments